using ASP;
using HoWave.Common;
using HoWave.Web;
using HoWave.Web.Shop;
using System;
using System.Web.Profile;
using System.Web.SessionState;
using ucApi;
public class Passport_Logout : Shop, IRequiresSessionState
{
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		string text = Fetch.GetOrPost("ComeUrl");
		if (text == string.Empty)
		{
			try
			{
				text = this.Page.Request.UrlReferrer.ToString();
			}
			catch
			{
			}
		}
		if (text == string.Empty)
		{
			text = this.config["SiteUrl"].ToString();
		}
		AppSetings appSetings = new AppSetings();
		if (appSetings.GetConfig("UC_ONorOFF") == "ON")
		{
			string s = Func.uc_user_synlogout();
			base.Response.Write(s);
		}
		base.user.Logout();
		if (this.config["HLIntegration"].ToString() == "1")
		{
			new Integrate(this.conn)
			{
				ComeUrl = text
			}.Send("Logout", "", "", "", "", "", 0, "", "");
		}
		else
		{
			this.WriteSuccessMsg("", Language.Get("PassPort/LogoutSuccess"), text);
		}
	}
}
